home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / dejagnu.lha / dejagnu-1.0.1 / tcl / doc / History.3 < prev    next >
Text File  |  1993-02-14  |  3KB  |  74 lines

  1. '\"
  2. '\" Copyright 1989 Regents of the University of California
  3. '\" Permission to use, copy, modify, and distribute this
  4. '\" documentation for any purpose and without fee is hereby
  5. '\" granted, provided that this notice appears in all copies.
  6. '\" The University of California makes no representations about
  7. '\" the suitability of this material for any purpose.  It is
  8. '\" provided "as is" without express or implied warranty.
  9. '\" 
  10. .\" The definitions below are for supplemental macros used in Sprite
  11. .\" manual entries.
  12. .\"
  13. .so man.macros
  14. .HS Tcl_InitHistory tcl
  15. .BS
  16. .SH NAME
  17. Tcl_InitHistory, Tcl_RecordAndEval \- procedures for managing history list
  18. .SH SYNOPSIS
  19. .nf
  20. \fB#include <tcl.h>\fR
  21. .sp
  22. .VS
  23. \fBTcl_InitHistory\fR(\fIinterp\fR)
  24. .VE
  25. .sp
  26. int
  27. \fBTcl_RecordAndEval\fR(\fIinterp, cmd, flags\fR)
  28. .SH ARGUMENTS
  29. .AS Tcl_Interp *interp;
  30. .AP Tcl_Interp *interp in
  31. Tcl interpreter in which history facilities are being used.
  32. .AP char *cmd in
  33. Command (or sequence of commands) to execute.
  34. .AP char flags in
  35. Flags to pass to \fBTcl_Eval\fR (normally 0).  If -1, then the
  36. command is not executed;  it's just recorded.
  37. .BE
  38.  
  39. .SH DESCRIPTION
  40. .PP
  41. The procedure \fBTcl_HistoryInit\fR is invoked to enable the
  42. .VS
  43. history facilities in an interpreter (by default there is no
  44. \fBhistory\fR command in an interpreter).
  45. After this command has been executed the \fBhistory\fR
  46. command will be available in \fIinterp\fR and the history facilities
  47. will be initialized.
  48. \fBTcl_HistoryInit\fR is invoked automatically by
  49. \fBTcl_RecordAndEval\fR, so it need not be invoked explicitly
  50. unless the \fBhistory\fR command is to
  51. be used before \fBTcl_RecordAndEval\fR has been called.
  52. .VE
  53. .PP
  54. \fBTcl_RecordAndEval\fR is invoked to record a command on the history
  55. list and then execute it.  Programs that do not wish to use the history
  56. mechanism should not call \fBTcl_RecordAndEval\fR;  they should call
  57. \fBTcl_Eval\fR instead.  Furthermore, \fBTcl_RecordAndEval\fR should
  58. only be called with top-level commands typed by the user, since the
  59. purpose of history is to allow the user to re-issue recently-invoked
  60. commands.
  61. .PP
  62. \fBTcl_RecordAndEval\fR does three things.
  63. First, it calls \fBTcl_HistoryInit\fR to initialize history for the
  64. interpreter \fIinterp\fR, if this hasn't already been done.
  65. Second, \fBTcl_RecordAndEval\fR saves \fIcommand\fR in
  66. the history list for \fIinterp\fR, making a new event to hold the
  67. command.
  68. Third, \fBTcl_RecordAndEval\fR executes the command by passing it
  69. and \fIflags\fR to \fBTcl_Eval\fR.  If \fIflags\fR is -1 then only
  70. the first two steps are taken;  the command will not be executed.
  71.  
  72. .SH KEYWORDS
  73. command, event, execute, history, interpreter, record
  74.